<?php
/**
 * Template Name: Submit A Short Sale BLOG.PHP???
 *
 * @package WordPress
 * @subpackage Master Theme
 */

get_header(); ?>

    <div id="container">
        <div id="content" role="main">
            
            <?php
				if ( isset($_POST['ssSubmit']) ) {
					
					$errors = array();
					
					if ( $_POST['yourFName'] != '' ) { $yourFName = $_POST['yourFName']; } else { $errors[] = 'Please Provide Your First Name.'; }
					if ( $_POST['yourLName'] != '' ) { $yourLName = $_POST['yourLName']; } else { $errors[] = 'Please Provide Your Last Name.'; }
					if ( $_POST['yourEmail'] != '' ) { $yourEmail = $_POST['yourEmail']; } else { $errors[] = 'Please Provide Your Email.'; }
					if ( $_POST['yourPhone'] != '' ) { $yourPhone = $_POST['yourPhone']; } else { $errors[] = 'Please Provide Your Phone Number.'; }
					//if ( $_POST['ssDate'] != '' ) { $ssDate = $_POST['ssDate']; } else { $errors[] = 'Please Provide the Current Date'; }
					if ( $_POST['ssListingPrice'] != '' ) { $ssListingPrice = $_POST['ssListingPrice']; } else { $errors[] = 'Please Provide Listing Price'; }
					if ( $_POST['ssListingDate'] != '' ) { $ssListingDate = $_POST['ssListingDate']; } else { $errors[] = 'Please Provide Listing Date'; }
					if ( $_POST['ssListingExpirationDate'] != '' ) { $ssListingExpirationDate = $_POST['ssListingExpirationDate']; } else { $errors[] = 'Please Provide Listing Expiration Date'; }
					if ( $_POST['ssEquatorUserName'] != '' ) { $ssEquatorUserName = $_POST['ssEquatorUserName']; } else { $errors[] = 'Please Provide Equator User Name'; }
					if ( $_POST['ssEquatorPassword'] != '' ) { $ssEquatorPassword = $_POST['ssEquatorPassword']; } else { $errors[] = 'Please Provide Equator Password'; }
					if ( $_POST['ssCompany'] != '' ) { $ssCompany = $_POST['ssCompany']; } else { $errors[] = 'Please Provide Title Company '; }
					if ( $_POST['ssContact'] != '' ) { $ssContact = $_POST['ssContact']; } else { $errors[] = 'Please Provide Title Company Contact'; }
					if ( $_POST['ssPhone'] != '' ) { $ssPhone = $_POST['ssPhone']; } else { $errors[] = 'Please Provide Title Company Phone'; }
					if ( $_POST['ssEmail'] != '' ) { $ssEmail = $_POST['ssEmail']; } else { $errors[] = 'Please Provide Title Company Email'; }
					if ( $_POST['ssaID'] != '' ) { $ssaID = $_POST['ssaID']; } else { $errors[] = 'No Assistant Selected!'; }
					
					if ( empty($errors) ) {
						// SUCCESS
						$ssa = get_user_by('id', $ssaID);
						print_r($ssa->user_email);
					} else {
						// FAILURE
						echo '<ul>';
							foreach ( $errors as $error ) {
								echo '<li>' . $error . '...</li>';
							}
						echo '</ul>';
					}
				} else {
            ?>

                <form action="" method="post" name="submit-s-s" id="submit-ss">
                    
                    <h3>CONTACT INFORMATION</h3>
                    <label for="yourFName">First Name</label>
                    <input name="yourFName" type="text" /><br />
    
                    <label for="yourLName">Last Name</label>
                    <input name="yourLName" type="text" /><br />
                    
                    <label for="yourEmail">Email</label>
                    <input name="yourEmail" type="text" /><br />
                    
                    <label for="yourPhone">Phone</label>
                    <input name="yourPhone" type="text" /><br />
    
                    <!--<label for="ssDate">Date</label>
                    <input name="ssDate" type="text" /><br />-->
    
                    <h3>LISTING INFORMATION</h3>
                    <label for="ssListingPrice">Listing Price</label>
                    <input name="ssListingPrice" type="text" /><br />
    
                    <label for="ssListingDate">Listing Date</label>
                    <input name="ssListingDate" type="text" /><br />
    
                    <label for="ssListingExpirationDate">Listing Expiration Date</label>
                    <input name="ssListingExpirationDate" type="text" /><br />
    
                    <h3>EQUATOR INFORMATION</h3>
                    <label for="ssEquatorUserName">Equator User Name</label>
                    <input name="ssEquatorUserName" type="text" /><br />
    
                    <label for="ssEquatorPassword">Equator Password</label>
                    <input name="ssEquatorPassword" type="text" /><br />
    
                    <h3>TITLE INFORMATION</h3>
                    <label for="ssCompany">Company</label>
                    <input name="ssCompany" type="text" /><br />
    
                    <label for="ssContact">Contact</label>
                    <input name="ssContact" type="text" /><br />
    
                    <label for="ssPhone">Phone</label>
                    <input name="ssPhone" type="text" /><br />
    
                    <label for="ssEmail">Email</label>
                    <input name="ssEmail" type="text" /><br />
    
    
    
                    <input name="ssaID" type="hidden" value="<?php if ( $_GET['ssaID'] != '' ) { echo $_GET['ssaID']; } ?>" />
                    
                    <input name="ssSubmit" type="submit" value="Submit Short Sale" />
                </form>
            
            <?php } ?>
            
        </div><!-- #content -->
    </div><!-- #container -->
        


    <div style="clear:both;"></div>

<?php get_footer(); ?>